package com.sun.androidexerciseproject.widget.activity.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatCheckBox;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CheckedTextView;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.ToggleButton;

import com.sun.androidexerciseproject.widget.R;
import com.sun.androidexerciseproject.widget.view.JftWebView;

public class WidgetActivity extends AppCompatActivity {
    public static final String URL = "http://wx.sbde.org/wxapi/bb.php";
    private CheckedTextView mCtText;
    private Button mBtnSimple;
    private AppCompatButton mBtnAppCompat;
    private ToggleButton mBtnTg;
    private CheckBox mCbBox;
    private AppCompatCheckBox mCbAppCompat;
    private RadioButton mRbBtn;
    private Spinner mSpinner;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_widget);
        initView();
    }

    private void initView() {
        mCtText = (CheckedTextView) findViewById(R.id.ct_text);
        mBtnSimple = (Button) findViewById(R.id.btn_simple);
        mBtnAppCompat = (AppCompatButton) findViewById(R.id.btn_app_compat);
        mBtnTg = (ToggleButton) findViewById(R.id.btn_tg);
        mCbBox = (CheckBox) findViewById(R.id.cb_box);
        mCbAppCompat = (AppCompatCheckBox) findViewById(R.id.cb_app_compat);
        mRbBtn = (RadioButton) findViewById(R.id.rb_btn);
        mSpinner = (Spinner) findViewById(R.id.spinner);
        JftWebView webView = new JftWebView(this);
        webView.loadUrl(URL);
    }
}
